<?php
/**
 * @version		$Id:  $
 * @package		Success Framework Mobile
 * @subpackage	Helper
 * @copyright	Copyright (C) 2007 - 2010 Success company - VietNam. All rights reserved.
 */
 
defined('PATH_BASE') or die();
   
class sscls_Template extends sscls_Router
{
     //View current
    var $view='index';
    
    //Layout current
    var $layout='default';
    
    function index()
    {
        global $config;
        $path=PATH_TMPL.TMPL.DS.'index.php';
        if($this->fileexists($path))
        {
            $this->load($path);    
        }
        else
            die('File '.$path.' not found');   
    }
    
    function loadCom()
    {
             
        $controlname=$this->getController();
        $task=$this->getTask();
        $path=PATH_CONTROLLER.$controlname.'.php';
        
        if($this->fileexists($path))
        {         
            $this->load($path);
            $classname="sscls_".$controlname."Controller";   
            $controller=new $classname();  
            $controller->$task();    
        }
        else
            die('File '.$path.' not found');
            
    }
    
} 
?>